package com.example.demo.config;

import com.example.demo.model.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ResponseBody;
@Slf4j
@ControllerAdvice
@ResponseBody
public class ExceptionAdvice {
    public Object handle(Exception e){
        log.info("接收到异常 e",e);
        return Result.fail("内部错误,请联系管理员");
    }
}
